package id.web.faisalabdillah.xtimesheet.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.google.appengine.api.datastore.Key;

@Entity
public class TimeSheetDetail {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Key id;
	
	@Column
	@ManyToOne
	private TimeSheet timesheet;
	
	@DateTimeFormat(pattern="dd-MM-yyyy")
	@Column
	@Temporal(TemporalType.DATE)
	private Date date;
	
	@Column
	private String status;
	
	@DateTimeFormat(pattern="HH:mm")
	@Column
	@Temporal(TemporalType.TIME)
	private Date start_hour;
	
	@DateTimeFormat(pattern="HH:mm")
	@Column
	@Temporal(TemporalType.TIME)
	private Date finish_hour;
	
	@Column
	private int job_hour;
	
	@DateTimeFormat(pattern="HH:mm")
	@Column
	@Temporal(TemporalType.TIME)
	private Date ot_start;
	
	@DateTimeFormat(pattern="HH:mm")
	@Column
	@Temporal(TemporalType.TIME)
	private Date ot_finish;
	
	private String activity;
	/**
	 * @return the activity
	 */
	public String getActivity() {
		return activity;
	}

	/**
	 * @param activity the activity to set
	 */
	public void setActivity(String activity) {
		this.activity = activity;
	}

	@Column
	private int ot_hour;

	public Key getId() {
		return id;
	}

	public void setId(Key id) {
		this.id = id;
	}


	public TimeSheet getTimesheet() {
		return timesheet;
	}

	public void setTimesheet(TimeSheet timesheet) {
		this.timesheet = timesheet;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getStart_hour() {
		return start_hour;
	}

	public void setStart_hour(Date start_hour) {
		this.start_hour = start_hour;
	}

	public Date getFinish_hour() {
		return finish_hour;
	}

	public void setFinish_hour(Date finish_hour) {
		this.finish_hour = finish_hour;
	}

	public int getJob_hour() {
		return job_hour;
	}

	public void setJob_hour(int job_hour) {
		this.job_hour = job_hour;
	}

	public Date getOt_start() {
		return ot_start;
	}

	public void setOt_start(Date ot_start) {
		this.ot_start = ot_start;
	}

	public Date getOt_finish() {
		return ot_finish;
	}

	public void setOt_finish(Date ot_finish) {
		this.ot_finish = ot_finish;
	}

	public int getOt_hour() {
		return ot_hour;
	}

	public void setOt_hour(int ot_hour) {
		this.ot_hour = ot_hour;
	}
}
